package com.mylibrary.service;

import com.mylibrary.dao.ReaderInfoDao;
import com.mylibrary.domain.ReaderInfo;
import com.mylibrary.domain.ReaderLogin;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LogInServiceImpl implements LogInService{
    @Resource
    private ReaderInfoDao readerInfoDao;
    @Override
    public int logIn(ReaderLogin readerLogin) {
       List<ReaderLogin>l= readerInfoDao.selectToLogIn();
        System.out.println(readerLogin);
        System.out.println(l.contains(readerLogin));
        if(l.contains(readerLogin)){
           return 1;
       }else{
           return -1;
       }
    }
}
